/* 
	Vuex
	- UserInfo 
	-- token
	-- loginCode
	-- openid
 */

const user = {
	namespaced: true,
	state: () => ({
		token: undefined,
		userInfo: null
	}),
	mutations: {
		setToken(state, val) {
			state.token = val
		},
		setUserInfo(state,val){
			state.userInfo = val
		},
		rmToken(state) {
			// 清除Token即清除Userinfo
			state.token = undefined;
			state.userInfo = undefined;
		}
	}
}

export default user